$(function()
{
	//单击删除超链接的事件处理
	$("#delSel").click(function()
	{
		var pid = $("#hd_id").val();
		var $arrKeyIndex = $("input[name='keyIndex']:checked");
		var keyIds = 0;
		for( var i = 0;i < $arrKeyIndex.length;i++)
		{  
			keyIds++;
		}
		var arr_ids = sel_data($arrKeyIndex);  //获取选中复选框的值
		if(keyIds > 0)
		{
			var result = confirm("确认删除吗？");
			if(result==true)
			{
				$.post(ctx+"/manage/sys/user/delUser1.htm",{ids:arr_ids+""},function(data)
				{
					alert(data);
					window.location=ctx+"/manage/sys/user/getDiffUser.htm?pid="+pid;
				});
			}
			else
			{
				return false;
			}
		}
		else
		{
			alert("请选择记录！");
			return false;
		}
	});
});


function a_del(id,pid)
{
	if(confirm("确认删除吗？"))
	{
		$.post(ctx+"/manage/sys/user/delUser2.htm",{id:id},function(data)
		{
			alert(data);
			window.location=ctx+"/manage/sys/user/getDiffUser.htm?pid="+pid;
		});
	}
	else
	{
		return false;
	}
}



//获取选中复选框的数据ID
function sel_data($arrKeyIndex){
	var arr_ids = [];
	$arrKeyIndex.each(function()
	{
		var obj=this.value;
		arr_ids.push(obj);
	});
	arr_ids.join(",");
	return arr_ids;
}